import request from '@/config/axios'

// 模板分类 VO
export interface TemplateCategoryVO {
  id: number // 主键ID
  categoryName: string // 素材分类名称
  status: number // 状态
}

// 模板分类 API
export const TemplateCategoryApi = {
  // 查询模板分类分页
  getTemplateCategoryPage: async (params: any) => {
    return await request.get({ url: `/system/template-category/page`, params })
  },

  // 查询模板分类详情
  getTemplateCategory: async (id: number) => {
    return await request.get({ url: `/system/template-category/get?id=` + id })
  },

  // 新增模板分类
  createTemplateCategory: async (data: TemplateCategoryVO) => {
    return await request.post({ url: `/system/template-category/create`, data })
  },

  // 修改模板分类
  updateTemplateCategory: async (data: TemplateCategoryVO) => {
    return await request.put({ url: `/system/template-category/update`, data })
  },

  // 删除模板分类
  deleteTemplateCategory: async (id: number) => {
    return await request.delete({ url: `/system/template-category/delete?id=` + id })
  },

  // 导出模板分类 Excel
  exportTemplateCategory: async (params) => {
    return await request.download({ url: `/system/template-category/export-excel`, params })
  },
}